package com.itszt.portol.controller;

import com.itszt.common.VO.ChannerOb;
import com.itszt.pojo.TbContent;
import com.itszt.portol.feign.IBigAdProviderFeign;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class BigADController {
    @Resource
    private IBigAdProviderFeign contentService;
    @Value("${width}")
    private int width;
    @Value("${height}")
    private int height;


    @RequestMapping("getBigADS")
    public List<BigADVO> showBigAD(){

        ChannerOb channerOb = contentService.showBigAds();
        List<TbContent> tbContents = channerOb.getData();
        List<BigADVO> bigADVOS = BigADVO.toBigADVO(tbContents,width,height);

        return bigADVOS;


    }
}
